package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.bo.WxglMallManagementControllerBo.ClearHistoryBo;
import com.cskaoyan.bean.common.BasePageInfo;
import com.cskaoyan.bean.common.BaseRespVo;
import com.cskaoyan.bean.marketBean.MarketUser;
import com.cskaoyan.bean.vo.WxglMallManagementControllerVo.*;
import com.cskaoyan.service.WxglCatalogService;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.Valid;
import java.util.List;

/**
 * @author wxgl
 * @date 2022-12-31 11:48
 * @describe
 */
@RequestMapping("wx")
@RestController
public class WxglCatalogController {

    @Autowired
    WxglCatalogService wxglCatalogService;

    /**
     * @Author xiaowu
     * @Description //TODO 显示指定类目的信息
     * @Date 11:50 2022/12/31
     * @Param [id] ttp://182.92.235.201:8083/wx/catalog/current?id=1005000
     * @return {"errno":0,"data":{"currentCategory":{"id":1005000,"name":"居家11","keywords":"","desc":"回家，放松身心","pid":0,"iconUrl":"http://yanxuan.nosdn.127.net/a45c2c262a476fea0b9fc684fed91ef5.png","picUrl":"http://yanxuan.nosdn.127.net/e8bf0cf08cf7eda21606ab191762e35c.png","level":"L1","sortOrder":2,"addTime":"2018-02-01 00:00:00","updateTime":"2022-11-24 17:35:07","deleted":false},"currentSubCategory":[{"id":1008002,"name":"布艺软装","keywords":"","desc":"各种风格软装装点你的家","pid":1005000,"iconUrl":"http://yanxuan.nosdn.127.net/8bbcd7de60a678846664af998f57e71c.png","picUrl":"http://yanxuan.nosdn.127.net/2e2fb4f2856a021bbcd1b4c8400f2b06.png","level":"L2","sortOrder":6,"addTime":"2018-02-01 00:00:00","updateTime":"2022-11-24 10:17:07","deleted":false},{"id":1008008,"name":"被枕","keywords":"","desc":"守护你的睡眠时光","pid":1005000,"iconUrl":"http://yanxuan.nosdn.127.net/927bc33f7ae2895dd6c11cf91f5e3228.png","picUrl":"http://yanxuan.nosdn.127.net/b43ef7cececebe6292d2f7f590522e05.png","level":"L2","sortOrder":2,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1008009,"name":"床品件套","keywords":"","desc":"MUJI等品牌制造商出品","pid":1005000,"iconUrl":"http://yanxuan.nosdn.127.net/243e5bf327a87217ad1f54592f0176ec.png","picUrl":"http://yanxuan.nosdn.127.net/81f671bd36bce05d5f57827e5c88dd1b.png","level":"L2","sortOrder":4,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1008016,"name":"灯具","keywords":"","desc":"一盏灯，温暖一个家","pid":1005000,"iconUrl":"http://yanxuan.nosdn.127.net/c48e0d9dcfac01499a437774a915842b.png","picUrl":"http://yanxuan.nosdn.127.net/f702dc399d14d4e1509d5ed6e57acd19.png","level":"L2","sortOrder":8,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1010003,"name":"地垫","keywords":"","desc":"家里的第“五”面墙","pid":1005000,"iconUrl":"http://yanxuan.nosdn.127.net/83d4c87f28c993af1aa8d3e4d30a2fa2.png","picUrl":"http://yanxuan.nosdn.127.net/1611ef6458e244d1909218becfe87c4d.png","level":"L2","sortOrder":5,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1011003,"name":"床垫","keywords":"","desc":"承托你的好时光","pid":1005000,"iconUrl":"http://yanxuan.nosdn.127.net/316afeb3948b295dfe073e4c51f77a42.png","picUrl":"http://yanxuan.nosdn.127.net/d6e0e84961032fc70fd52a8d4d0fb514.png","level":"L2","sortOrder":3,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1011004,"name":"家饰","keywords":"","desc":"装饰你的家","pid":1005000,"iconUrl":"http://yanxuan.nosdn.127.net/ab0df9445d985bf6719ac415313a8e88.png","picUrl":"http://yanxuan.nosdn.127.net/79275db76b5865e6167b0fbd141f2d7e.png","level":"L2","sortOrder":9,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1015000,"name":"家具","keywords":"","desc":"大师级工艺","pid":1005000,"iconUrl":"http://yanxuan.nosdn.127.net/4f00675caefd0d4177892ad18bfc2df6.png","picUrl":"http://yanxuan.nosdn.127.net/d5d41841136182bf49c1f99f5c452dd6.png","level":"L2","sortOrder":7,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1017000,"name":"宠物","keywords":"","desc":"抑菌除味，打造宠物舒适空间","pid":1005000,"iconUrl":"http://yanxuan.nosdn.127.net/a0352c57c60ce4f68370ecdab6a30857.png","picUrl":"http://yanxuan.nosdn.127.net/dae4d6e89ab8a0cd3e8da026e4660137.png","level":"L2","sortOrder":10,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1018000,"name":"夏日甜心","keywords":"","desc":"湖南卫视《夏日甜心》周边","pid":1005000,"iconUrl":"http://yanxuan.nosdn.127.net/b5e9f174404ef81b8603d6ecc304c62e.png","picUrl":"http://yanxuan.nosdn.127.net/2b8497fe583d3c9759128b2d76f89dfd.png","level":"L2","sortOrder":10,"addTime":"2018-02-01 00:00:00","updateTime":"2022-11-23 21:59:44","deleted":false},{"id":1036000,"name":"夏凉","keywords":"","desc":"夏凉床品，舒适一夏","pid":1005000,"iconUrl":"http://yanxuan.nosdn.127.net/13ff4decdf38fe1a5bde34f0e0cc635a.png","picUrl":"http://yanxuan.nosdn.127.net/bd17c985bacb9b9ab1ab6e9d66ee343c.png","level":"L2","sortOrder":1,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1036124,"name":"水电费","keywords":"双方","desc":"身份","pid":1005000,"iconUrl":"http://182.92.235.201:8083/wx/storage/fetch/7b75ihacf1ygqpctiiaj.jpg","picUrl":"http://182.92.235.201:8083/wx/storage/fetch/ilw8c7jox1yb3ywi82gq.jpg","level":"L2","sortOrder":50,"addTime":"2022-12-30 13:49:52","updateTime":"2022-12-30 13:49:52","deleted":false}]},"errmsg":"成功"}
     **/


    @RequestMapping("catalog/current")
    public BaseRespVo catalogCurrent(Integer id){
        CatalogCurrentVo catalogCurrentVo = wxglCatalogService.catalogCurrent(id);
        return BaseRespVo.success(catalogCurrentVo);
    }

    /**
     * @Author xiaowu
     * @Description //TODO 显示所有的商品信息，和指定（第一个）商品信息
     * @Date 13:11 2022/12/31
     * @Param []
     * @return {"errno":0,"data":{"currentCategory":{"id":1005000,"name":"居家11","keywords":"","desc":"回家，放松身心","pid":0,"iconUrl":"http://yanxuan.nosdn.127.net/a45c2c262a476fea0b9fc684fed91ef5.png","picUrl":"http://yanxuan.nosdn.127.net/e8bf0cf08cf7eda21606ab191762e35c.png","level":"L1","sortOrder":2,"addTime":"2018-02-01 00:00:00","updateTime":"2022-11-24 17:35:07","deleted":false},"categoryList":[{"id":1005000,"name":"居家11","keywords":"","desc":"回家，放松身心","pid":0,"iconUrl":"http://yanxuan.nosdn.127.net/a45c2c262a476fea0b9fc684fed91ef5.png","picUrl":"http://yanxuan.nosdn.127.net/e8bf0cf08cf7eda21606ab191762e35c.png","level":"L1","sortOrder":2,"addTime":"2018-02-01 00:00:00","updateTime":"2022-11-24 17:35:07","deleted":false},{"id":1005001,"name":"餐厨","keywords":"","desc":"爱，囿于厨房","pid":0,"iconUrl":"http://yanxuan.nosdn.127.net/ad8b00d084cb7d0958998edb5fee9c0a.png","picUrl":"http://yanxuan.nosdn.127.net/3708dbcb35ad5abf9e001500f73db615.png","level":"L1","sortOrder":3,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1005002,"name":"饮食","keywords":"","desc":"好吃，高颜值美食","pid":0,"iconUrl":"http://yanxuan.nosdn.127.net/c9280327a3fd2374c000f6bf52dff6eb.png","picUrl":"http://yanxuan.nosdn.127.net/fb670ff3511182833e5b035275e4ac09.png","level":"L1","sortOrder":9,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1008000,"name":"配件","keywords":"","desc":"配角，亦是主角","pid":0,"iconUrl":"http://yanxuan.nosdn.127.net/11abb11c4cfdee59abfb6d16caca4c6a.png","picUrl":"http://yanxuan.nosdn.127.net/02f9a44d05c05c0dd439a5eb674570a2.png","level":"L1","sortOrder":4,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1010000,"name":"服装","keywords":"","desc":"贴身的，要亲肤","pid":0,"iconUrl":"http://yanxuan.nosdn.127.net/28a685c96f91584e7e4876f1397767db.png","picUrl":"http://yanxuan.nosdn.127.net/622c8d79292154017b0cbda97588a0d7.png","level":"L1","sortOrder":5,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1011000,"name":"婴童","keywords":"","desc":"爱，从心开始","pid":0,"iconUrl":"http://yanxuan.nosdn.127.net/1ba9967b8de1ac50fad21774a4494f5d.png","picUrl":"http://yanxuan.nosdn.127.net/9cc0b3e0d5a4f4a22134c170f10b70f2.png","level":"L1","sortOrder":7,"addTime":"2018-02-01 00:00:00","updateTime":"2022-12-29 21:13:56","deleted":false},{"id":1012000,"name":"杂货","keywords":"","desc":"解忧，每个烦恼","pid":0,"iconUrl":"http://yanxuan.nosdn.127.net/c2a3d6349e72c35931fe3b5bcd0966be.png","picUrl":"http://yanxuan.nosdn.127.net/547853361d29a37282f377b9a755dd37.png","level":"L1","sortOrder":8,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1013001,"name":"洗护","keywords":"","desc":"亲肤之物，严选天然","pid":0,"iconUrl":"http://yanxuan.nosdn.127.net/9fe068776b6b1fca13053d68e9c0a83f.png","picUrl":"http://yanxuan.nosdn.127.net/1526ab0f5982722adbc8726f9f2a338c.png","level":"L1","sortOrder":6,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1019000,"name":"志趣","keywords":"","desc":"周边精品，共享热爱","pid":0,"iconUrl":"http://yanxuan.nosdn.127.net/7093cfecb9dde1dd3eaf459623df4071.png","picUrl":"http://yanxuan.nosdn.127.net/1706e24a5e605870ba3b37ff5f49aa18.png","level":"L1","sortOrder":10,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1036080,"name":"胖1","keywords":"胖虎","desc":"胖虎","pid":0,"iconUrl":"http://182.92.235.201:8083/wx/storage/fetch/whmdlrda87qz2ct6i6iv.png","picUrl":"http://182.92.235.201:8083/wx/storage/fetch/7p14phpqv4vokhvlr0po.png","level":"L1","sortOrder":50,"addTime":"2022-11-23 21:10:41","updateTime":"2022-11-23 22:58:56","deleted":false},{"id":1036083,"name":".","keywords":"关键字test-dmepgf","desc":"类目简介-dmepgf//delDMepgfupdate","pid":0,"iconUrl":"","picUrl":"","level":"L1","sortOrder":50,"addTime":"2022-11-24 10:26:31","updateTime":"2022-11-24 22:51:14","deleted":false},{"id":1036104,"name":"66666","keywords":"","desc":"5555555","pid":0,"iconUrl":"","picUrl":"","level":"L1","sortOrder":50,"addTime":"2022-12-29 21:17:10","updateTime":"2022-12-29 21:17:28","deleted":false},{"id":1036107,"name":"吃的","keywords":"吃吃吃","desc":"上山打老虎","pid":0,"iconUrl":"http://182.92.235.201:8083/wx/storage/fetch/w8msr9pri8u7ys0l2qy8.png","picUrl":"","level":"L1","sortOrder":50,"addTime":"2022-12-29 23:19:09","updateTime":"2022-12-29 23:19:09","deleted":false},{"id":1036114,"name":"```````","keywords":"玩具","desc":"aa","pid":0,"iconUrl":"http://182.92.235.201:8083/wx/storage/fetch/hc5rniz7wzrkjgv57ycj.jpg","picUrl":"http://182.92.235.201:8083/wx/storage/fetch/j3gwd6v89vklqt9cs1or.jpg","level":"L1","sortOrder":50,"addTime":"2022-12-30 07:08:19","updateTime":"2022-12-30 16:18:19","deleted":false},{"id":1036115,"name":"松松散散","keywords":"aaaa","desc":"","pid":0,"iconUrl":"","picUrl":"","level":"L1","sortOrder":50,"addTime":"2022-12-30 07:09:57","updateTime":"2022-12-30 07:52:56","deleted":false},{"id":1036137,"name":"123","keywords":"22","desc":"12","pid":0,"iconUrl":"","picUrl":"","level":"L1","sortOrder":50,"addTime":"2022-12-30 17:12:20","updateTime":"2022-12-30 17:12:20","deleted":false}],"currentSubCategory":[{"id":1008002,"name":"布艺软装","keywords":"","desc":"各种风格软装装点你的家","pid":1005000,"iconUrl":"http://yanxuan.nosdn.127.net/8bbcd7de60a678846664af998f57e71c.png","picUrl":"http://yanxuan.nosdn.127.net/2e2fb4f2856a021bbcd1b4c8400f2b06.png","level":"L2","sortOrder":6,"addTime":"2018-02-01 00:00:00","updateTime":"2022-11-24 10:17:07","deleted":false},{"id":1008008,"name":"被枕","keywords":"","desc":"守护你的睡眠时光","pid":1005000,"iconUrl":"http://yanxuan.nosdn.127.net/927bc33f7ae2895dd6c11cf91f5e3228.png","picUrl":"http://yanxuan.nosdn.127.net/b43ef7cececebe6292d2f7f590522e05.png","level":"L2","sortOrder":2,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1008009,"name":"床品件套","keywords":"","desc":"MUJI等品牌制造商出品","pid":1005000,"iconUrl":"http://yanxuan.nosdn.127.net/243e5bf327a87217ad1f54592f0176ec.png","picUrl":"http://yanxuan.nosdn.127.net/81f671bd36bce05d5f57827e5c88dd1b.png","level":"L2","sortOrder":4,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1008016,"name":"灯具","keywords":"","desc":"一盏灯，温暖一个家","pid":1005000,"iconUrl":"http://yanxuan.nosdn.127.net/c48e0d9dcfac01499a437774a915842b.png","picUrl":"http://yanxuan.nosdn.127.net/f702dc399d14d4e1509d5ed6e57acd19.png","level":"L2","sortOrder":8,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1010003,"name":"地垫","keywords":"","desc":"家里的第“五”面墙","pid":1005000,"iconUrl":"http://yanxuan.nosdn.127.net/83d4c87f28c993af1aa8d3e4d30a2fa2.png","picUrl":"http://yanxuan.nosdn.127.net/1611ef6458e244d1909218becfe87c4d.png","level":"L2","sortOrder":5,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1011003,"name":"床垫","keywords":"","desc":"承托你的好时光","pid":1005000,"iconUrl":"http://yanxuan.nosdn.127.net/316afeb3948b295dfe073e4c51f77a42.png","picUrl":"http://yanxuan.nosdn.127.net/d6e0e84961032fc70fd52a8d4d0fb514.png","level":"L2","sortOrder":3,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1011004,"name":"家饰","keywords":"","desc":"装饰你的家","pid":1005000,"iconUrl":"http://yanxuan.nosdn.127.net/ab0df9445d985bf6719ac415313a8e88.png","picUrl":"http://yanxuan.nosdn.127.net/79275db76b5865e6167b0fbd141f2d7e.png","level":"L2","sortOrder":9,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1015000,"name":"家具","keywords":"","desc":"大师级工艺","pid":1005000,"iconUrl":"http://yanxuan.nosdn.127.net/4f00675caefd0d4177892ad18bfc2df6.png","picUrl":"http://yanxuan.nosdn.127.net/d5d41841136182bf49c1f99f5c452dd6.png","level":"L2","sortOrder":7,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1017000,"name":"宠物","keywords":"","desc":"抑菌除味，打造宠物舒适空间","pid":1005000,"iconUrl":"http://yanxuan.nosdn.127.net/a0352c57c60ce4f68370ecdab6a30857.png","picUrl":"http://yanxuan.nosdn.127.net/dae4d6e89ab8a0cd3e8da026e4660137.png","level":"L2","sortOrder":10,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1018000,"name":"夏日甜心","keywords":"","desc":"湖南卫视《夏日甜心》周边","pid":1005000,"iconUrl":"http://yanxuan.nosdn.127.net/b5e9f174404ef81b8603d6ecc304c62e.png","picUrl":"http://yanxuan.nosdn.127.net/2b8497fe583d3c9759128b2d76f89dfd.png","level":"L2","sortOrder":10,"addTime":"2018-02-01 00:00:00","updateTime":"2022-11-23 21:59:44","deleted":false},{"id":1036000,"name":"夏凉","keywords":"","desc":"夏凉床品，舒适一夏","pid":1005000,"iconUrl":"http://yanxuan.nosdn.127.net/13ff4decdf38fe1a5bde34f0e0cc635a.png","picUrl":"http://yanxuan.nosdn.127.net/bd17c985bacb9b9ab1ab6e9d66ee343c.png","level":"L2","sortOrder":1,"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false},{"id":1036124,"name":"水电费","keywords":"双方","desc":"身份","pid":1005000,"iconUrl":"http://182.92.235.201:8083/wx/storage/fetch/7b75ihacf1ygqpctiiaj.jpg","picUrl":"http://182.92.235.201:8083/wx/storage/fetch/ilw8c7jox1yb3ywi82gq.jpg","level":"L2","sortOrder":50,"addTime":"2022-12-30 13:49:52","updateTime":"2022-12-30 13:49:52","deleted":false}]},"errmsg":"成功"}
     **/

    @RequestMapping("catalog/index")
    public BaseRespVo catalogIndex(){
        CatalogIndexVo catalogIndexVo = wxglCatalogService.catalogIndex();
        return BaseRespVo.success(catalogIndexVo);
    }

    /**
     * @Author xiaowu
     * @Description //TODO 搜索页面默认显示xinxi
     * @Date 13:45 2022/12/31
     * @Param []  http://182.92.235.201:8083/wx/search/index
     * @return {"errno":0,"data":{"defaultKeyword":{"id":38,"keyword":"马小艳","url":"","isHot":true,"isDefault":true,"sortOrder":100,"addTime":"2022-11-23 10:31:55","updateTime":"2022-11-27 13:50:45","deleted":false},"hotKeywordList":[{"id":6,"keyword":"520元礼包抢先领","url":"","isHot":true,"isDefault":false,"sortOrder":1,"addTime":"2018-02-01 00:00:00","updateTime":"2022-11-27 13:51:31","deleted":false},{"id":9,"keyword":"aa","url":"","isHot":true,"isDefault":false,"sortOrder":100,"addTime":"2022-11-20 22:28:23","updateTime":"2022-11-27 13:51:28","deleted":false},{"id":11,"keyword":"9527","url":"sdf","isHot":true,"isDefault":false,"sortOrder":100,"addTime":"2022-11-20 22:34:22","updateTime":"2022-11-20 22:52:27","deleted":false},{"id":12,"keyword":"111","url":"","isHot":true,"isDefault":false,"sortOrder":100,"addTime":"2022-11-20 22:43:25","updateTime":"2022-11-27 13:48:43","deleted":false},{"id":22,"keyword":"aaa","url":"50","isHot":true,"isDefault":false,"sortOrder":100,"addTime":"2022-11-21 16:58:41","updateTime":"2022-11-21 16:58:41","deleted":false},{"id":26,"keyword":"d夫为人父给我","url":"是啥","isHot":true,"isDefault":false,"sortOrder":100,"addTime":"2022-11-22 10:56:39","updateTime":"2022-11-22 10:56:39","deleted":false},{"id":27,"keyword":"aaa","url":"aaa","isHot":true,"isDefault":false,"sortOrder":100,"addTime":"2022-11-22 10:58:14","updateTime":"2022-11-22 10:58:14","deleted":false},{"id":30,"keyword":"77","url":"777","isHot":true,"isDefault":false,"sortOrder":100,"addTime":"2022-11-22 14:44:49","updateTime":"2022-11-27 13:50:49","deleted":false},{"id":31,"keyword":"null","url":"","isHot":true,"isDefault":false,"sortOrder":100,"addTime":"2022-11-23 10:30:54","updateTime":"2022-11-27 13:48:36","deleted":false},{"id":32,"keyword":"\uD83D\uDC34","url":"","isHot":true,"isDefault":false,"sortOrder":100,"addTime":"2022-11-23 10:31:01","updateTime":"2022-11-27 13:48:33","deleted":false},{"id":33,"keyword":"张航","url":"","isHot":true,"isDefault":false,"sortOrder":100,"addTime":"2022-11-23 10:31:07","updateTime":"2022-11-27 13:48:29","deleted":false},{"id":34,"keyword":"李洋洋","url":"","isHot":true,"isDefault":false,"sortOrder":100,"addTime":"2022-11-23 10:31:15","updateTime":"2022-11-27 13:48:26","deleted":false},{"id":35,"keyword":"林璇","url":"","isHot":true,"isDefault":false,"sortOrder":100,"addTime":"2022-11-23 10:31:22","updateTime":"2022-11-27 13:48:23","deleted":false},{"id":36,"keyword":"何香枝","url":"","isHot":true,"isDefault":false,"sortOrder":100,"addTime":"2022-11-23 10:31:35","updateTime":"2022-11-27 13:48:20","deleted":false},{"id":37,"keyword":"叶佩青","url":"","isHot":true,"isDefault":false,"sortOrder":100,"addTime":"2022-11-23 10:31:45","updateTime":"2022-11-27 13:48:15","deleted":false},{"id":38,"keyword":"马小艳","url":"","isHot":true,"isDefault":true,"sortOrder":100,"addTime":"2022-11-23 10:31:55","updateTime":"2022-11-27 13:50:45","deleted":false},{"id":39,"keyword":"\uD83D\uDC34","url":"\uD83D\uDC34","isHot":true,"isDefault":false,"sortOrder":100,"addTime":"2022-11-23 10:32:11","updateTime":"2022-11-27 13:48:06","deleted":false},{"id":40,"keyword":"\uD83D\uDC34\uD83D\uDC34\uD83D\uDC34\uD83D\uDC34\uD83D\uDC34\uD83D\uDC34\uD83D\uDC34\uD83D\uDC34\uD83D\uDC34\uD83D\uDC34\uD83D\uDC34\uD83D\uDC34\uD83D\uDC34\uD83D\uDC34\uD83D\uDC34\uD83D\uDC34","url":"","isHot":true,"isDefault":false,"sortOrder":100,"addTime":"2022-11-23 10:32:28","updateTime":"2022-11-27 13:48:02","deleted":false},{"id":41,"keyword":"周杰伦","url":"","isHot":true,"isDefault":false,"sortOrder":100,"addTime":"2022-11-23 10:32:35","updateTime":"2022-11-27 13:47:59","deleted":false},{"id":42,"keyword":"music","url":"","isHot":true,"isDefault":false,"sortOrder":100,"addTime":"2022-11-24 11:02:26","updateTime":"2022-11-27 13:47:55","deleted":false},{"id":55,"keyword":"sa","url":"s","isHot":true,"isDefault":true,"sortOrder":100,"addTime":"2022-12-30 21:48:58","updateTime":"2022-12-30 21:48:58","deleted":false}],"historyKeywordList":[]},"errmsg":"成功"}
     **/

    @RequestMapping("search/index")
    public BaseRespVo searchIndex(){
        MarketUser principal = (MarketUser) SecurityUtils.getSubject().getPrincipal();
        Integer userId = null;
        if (principal != null){
            userId = principal.getId();
        }
        SearchIndexVo searchIndexVo = wxglCatalogService.searchIndex(userId);
        return BaseRespVo.success(searchIndexVo);
    }

    /**
     * @Author xiaowu
     * @Description //TODO 通过关键词进行搜索对应的商品信息
     * @Date 15:45 2022/12/31
     * @Param []  http://182.92.235.201:8083/wx/search/helper?keyword=%E7%A4%BC%E5%8C%85
     * @return   {"errno":0,"data":["520元礼包抢先领"],"errmsg":"成功"}
     **/

    @RequestMapping("search/helper")
    public BaseRespVo searchHelper(String keyword){
        List<String> keywordList = wxglCatalogService.searchHelper(keyword);
        return BaseRespVo.success(keywordList);
    }

    /**
     * @Author xiaowu
     * @Description //TODO 清理历史查询记录
     * @Date 16:00 2022/12/31
     * @Param []
     * @return com.cskaoyan.bean.common.BaseRespVo
     **/

    @RequestMapping("search/clearhistory")
    public BaseRespVo searchClearhistory(@RequestBody @Valid ClearHistoryBo clearHistoryBo){
        wxglCatalogService.searchClearhistory(clearHistoryBo);

        return BaseRespVo.success();
    }

    /**
     * @Author xiaowu
     * @Description //TODO 专题展示
     * @Date 20:56 2022/12/31
     * @Param []  /wx/topic/list?page=1&limit=10
     * @return {"errno":0,"data":{"total":22,"pages":3,"limit":10,"page":1,"list":[{"id":368,"title":"666","subtitle":"6666","price":46.00,"readCount":"666","picUrl":"http://182.92.235.201:8083/wx/storage/fetch/li8ltyyykclbwap5deau.jpg"},{"id":367,"title":"111","subtitle":"111","price":111.00,"readCount":"11k","picUrl":""},{"id":366,"title":"劳斯莱斯优惠特卖","subtitle":"劳斯莱斯库里南重新出发","price":6100000.00,"readCount":"188.8k","picUrl":"http://182.92.235.201:8083/wx/storage/fetch/v28cxrd16zh2r6klyd87.jpg"},{"id":365,"title":"1234567i6543213uyi865432`45uio","subtitle":"2136423","price":111.00,"readCount":"131","picUrl":"http://182.92.235.201:8083/wx/storage/fetch/cdiuiu4wp76vi0hxapjn.jpg"},{"id":364,"title":"222","subtitle":"2222","price":222.00,"readCount":"2","picUrl":""},{"id":363,"title":"787412...","subtitle":"21235","price":-100.00,"readCount":"1k","picUrl":""},{"id":349,"title":"足球大促季111","subtitle":"足球热卖111","price":666.00,"readCount":"18k","picUrl":"http://182.92.235.201:8083/wx/storage/fetch/ecahwrdz66ph9fufuztn.jpg"},{"id":264,"title":"设计师们推荐的应季好物","subtitle":"原创设计春款系列上新","price":29.91,"readCount":"77.8k","picUrl":"https://yanxuan.nosdn.127.net/14918201901050274.jpg"},{"id":268,"title":"米饭好吃的秘诀：会呼吸的锅","subtitle":"今年1月份，我们联系到了日本伊贺地区的长谷园，那里有着180年伊贺烧历史的窑厂。...","price":0.00,"readCount":"33.3k","picUrl":"https://yanxuan.nosdn.127.net/14920623353130483.jpg"},{"id":272,"title":"料理也要精细简单","subtitle":"享受天然的味道，日子每天都好新鲜","price":69.00,"readCount":"125.6k","picUrl":"https://yanxuan.nosdn.127.net/14925200530030186.jpg"}]},"errmsg":"成功"}
     **/
    @RequestMapping("topic/list")
    public BaseRespVo topicList(Integer page, Integer limit){
        TopicListVo topicListVo = wxglCatalogService.topicList(page,limit);
        return BaseRespVo.success(topicListVo);
    }

    /**
     * @Author xiaowu
     * @Description //TODO 详细专题信息
     * @Date 21:29 2022/12/31
     * @Param []   /wx/topic/detail?id=368
     * @return  {"errno":0,"data":{"topic":{"id":368,"title":"666","subtitle":"6666","price":46.00,"readCount":"666","picUrl":"http://182.92.235.201:8083/wx/storage/fetch/li8ltyyykclbwap5deau.jpg","sortOrder":100,"goods":[1181017,1181014],"addTime":"2022-12-30 15:42:04","updateTime":"2022-12-30 15:42:04","deleted":false,"content":"<p>666666666666666666666</p>"},"goods":[{"id":1181017,"name":"手办模型y","brief":"手办小姐姐","picUrl":"http://182.92.235.201:8083/wx/storage/fetch/cs6cgge8thgp7g14v29q.jpg","isNew":true,"isHot":true,"counterPrice":3333.00,"retailPrice":0.00},{"id":1181014,"name":"手办模型","brief":"高级手办模型","picUrl":"http://182.92.235.201:8083/wx/storage/fetch/cixzjb9mhpoybdme2ugg.jpg","isNew":true,"isHot":false,"counterPrice":9999.00,"retailPrice":0.00}]},"errmsg":"成功"}
     **/
    @RequestMapping("topic/detail")
    public BaseRespVo topicDetail(Integer id){
        TopicDetailVo topicDetailVo = wxglCatalogService.topicDetail(id);
        return BaseRespVo.success(topicDetailVo);
    }

    /**
     * @Author xiaowu
     * @Description //TODO 相关专题
     * @Date 21:57 2022/12/31
     * @Param []  http://182.92.235.201:8083/wx/topic/related?id=368
     * @return {"errno":0,"data":{"total":21,"pages":6,"limit":4,"page":1,"list":[{"id":264,"title":"设计师们推荐的应季好物","subtitle":"原创设计春款系列上新","price":29.91,"readCount":"77.8k","picUrl":"https://yanxuan.nosdn.127.net/14918201901050274.jpg","sortOrder":0,"goods":[1181007],"addTime":"2018-02-01 00:00:00","updateTime":"2022-11-22 22:33:12","deleted":false,"content":"<img src=\"//yanxuan.nosdn.127.net/75c55a13fde5eb2bc2dd6813b4c565cc.jpg\">\n    <img src=\"//yanxuan.nosdn.127.net/e27e1de2b271a28a21c10213b9df7e95.jpg\">\n    <img src=\"//yanxuan.nosdn.127.net/9d413d1d28f753cb19096b533d53418d.jpg\">\n    <img src=\"//yanxuan.nosdn.127.net/64b0f2f350969e9818a3b6c43c217325.jpg\">\n    <img src=\"//yanxuan.nosdn.127.net/a668e6ae7f1fa45565c1eac221787570.jpg\">\n    <img src=\"//yanxuan.nosdn.127.net/0d4004e19728f2707f08f4be79bbc774.jpg\">\n    <img src=\"//yanxuan.nosdn.127.net/79ee021bbe97de7ecda691de6787241f.jpg\">"},{"id":268,"title":"米饭好吃的秘诀：会呼吸的锅","subtitle":"今年1月份，我们联系到了日本伊贺地区的长谷园，那里有着180年伊贺烧历史的窑厂。...","price":0.00,"readCount":"33.3k","picUrl":"https://yanxuan.nosdn.127.net/14920623353130483.jpg","sortOrder":0,"goods":[1006002],"addTime":"2018-02-01 00:00:00","updateTime":"2022-11-22 15:20:53","deleted":false,"content":"<img src=\"//yanxuan.nosdn.127.net/75c55a13fde5eb2bc2dd6813b4c565cc.jpg\">\n    <img src=\"//yanxuan.nosdn.127.net/e27e1de2b271a28a21c10213b9df7e95.jpg\">\n    <img src=\"//yanxuan.nosdn.127.net/9d413d1d28f753cb19096b533d53418d.jpg\">\n    <img src=\"//yanxuan.nosdn.127.net/64b0f2f350969e9818a3b6c43c217325.jpg\">\n    <img src=\"//yanxuan.nosdn.127.net/a668e6ae7f1fa45565c1eac221787570.jpg\">\n    <img src=\"//yanxuan.nosdn.127.net/0d4004e19728f2707f08f4be79bbc774.jpg\">\n    <img src=\"//yanxuan.nosdn.127.net/79ee021bbe97de7ecda691de6787241f.jpg\">"},{"id":272,"title":"料理也要精细简单","subtitle":"享受天然的味道，日子每天都好新鲜","price":69.00,"readCount":"125.6k","picUrl":"https://yanxuan.nosdn.127.net/14925200530030186.jpg","sortOrder":0,"goods":[1006002],"addTime":"2018-02-01 00:00:00","updateTime":"2022-11-22 15:47:19","deleted":false,"content":"<img src=\"//yanxuan.nosdn.127.net/75c55a13fde5eb2bc2dd6813b4c565cc.jpg\">\n    <img src=\"//yanxuan.nosdn.127.net/e27e1de2b271a28a21c10213b9df7e95.jpg\">\n    <img src=\"//yanxuan.nosdn.127.net/9d413d1d28f753cb19096b533d53418d.jpg\">\n    <img src=\"//yanxuan.nosdn.127.net/64b0f2f350969e9818a3b6c43c217325.jpg\">\n    <img src=\"//yanxuan.nosdn.127.net/a668e6ae7f1fa45565c1eac221787570.jpg\">\n    <img src=\"//yanxuan.nosdn.127.net/0d4004e19728f2707f08f4be79bbc774.jpg\">\n    <img src=\"//yanxuan.nosdn.127.net/79ee021bbe97de7ecda691de6787241f.jpg\">"},{"id":274,"title":"没有软木拖，怎么过夏天","subtitle":"刚入四月，杭州的气温就已升高至30度。店庆时买了软木拖的用户，陆续发回评价说，很...","price":0.00,"readCount":"46.4k","picUrl":"https://yanxuan.nosdn.127.net/14925822213780237.jpg","sortOrder":0,"goods":[],"addTime":"2018-02-01 00:00:00","updateTime":"2018-02-01 00:00:00","deleted":false,"content":"<img src=\"//yanxuan.nosdn.127.net/75c55a13fde5eb2bc2dd6813b4c565cc.jpg\">\n    <img src=\"//yanxuan.nosdn.127.net/e27e1de2b271a28a21c10213b9df7e95.jpg\">\n    <img src=\"//yanxuan.nosdn.127.net/9d413d1d28f753cb19096b533d53418d.jpg\">\n    <img src=\"//yanxuan.nosdn.127.net/64b0f2f350969e9818a3b6c43c217325.jpg\">\n    <img src=\"//yanxuan.nosdn.127.net/a668e6ae7f1fa45565c1eac221787570.jpg\">\n    <img src=\"//yanxuan.nosdn.127.net/0d4004e19728f2707f08f4be79bbc774.jpg\">\n    <img src=\"//yanxuan.nosdn.127.net/79ee021bbe97de7ecda691de6787241f.jpg\">"}]},"errmsg":"成功"}
     **/
    @RequestMapping("topic/related")
    public BaseRespVo topicRelated(Integer id){
        TopicRelatedVo topicRelatedVo = wxglCatalogService.topicRelated(id);
        return BaseRespVo.success(topicRelatedVo);
    }

    /**
     * @Author xiaowu
     * @Description //TODO 文件上传
     * @Date 13:44 2023/1/2
     * @Param []
     * @return com.cskaoyan.bean.common.BaseRespVo
     **/
    @RequestMapping("storage/upload")
    public BaseRespVo storageUpload(MultipartFile file){
        int code = wxglCatalogService.storageUpload(file);
        if (code == 10000){
            return BaseRespVo.invalidParameter("文件上传失败");
        }
        return BaseRespVo.success();
    }


}
